<%@page import="com.mbbmap.util.EncryptionHelper"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.ArrayList, java.util.TreeMap, com.classes.Casemast, com.classes.CaseOutlet, com.classes.Outlet" %>
<%@ page import = "com.mbbmap.util.Constants" %>
<%@ page import = "com.mbbmap.security.dao.*" %>
<%@ include file="/jsp/map/include/user-dao.jsp" %>	
<%
	String reg_name = "";
	String reg_no = "";
	String gst_registration = "";
	String rmcd_approval_no = "";
	String name = "";
	String contact_person = "";
	String designation = "";
	String email = "";
	String tel_no = "";
	String fax_no = "";
	String esa_ref_no = "";
	String no_of_terminal = "00";
	String terminal_rental = "";
	String terminal_owner = "";
	String license_no = "";
	String license_type = "";
	String state = "";
	String issuer = "";
	String expiry = "";
	String risk_level = "";
	String trm_deposit_wired = "";
	String trm_deposit_wireless = "";
	String trm_rental_deposit_wired = "";
	String trm_rental_deposit_wireless = "";
	String trm_rental_advance = "";
	String cheque_amt = "";
	String bank_issuer = "";
	String bank_branch = "";
	String cheque_no = "";
	String cheque_date = "";
	String terminal_id = "";
	String terminal_id_no = "";
	String terminal_install_date = "";
	
	if(request.getAttribute("m_case") != null) {
		reg_name = ((Casemast)request.getAttribute("m_case")).getMerchant().getRegisteredName();
		reg_no = ((Casemast)request.getAttribute("m_case")).getMerchant().getRegisteredNo();
		gst_registration = ((Casemast)request.getAttribute("m_case")).getMerchant().getGst_registration();
		rmcd_approval_no = ((Casemast)request.getAttribute("m_case")).getMerchant().getRmcd_approval_no();
	}
	
	if(request.getAttribute("c_outlet") != null) {
		reg_name = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getMerchant().getRegisteredName();
		reg_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getMerchant().getRegisteredNo();
		gst_registration = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getMerchant().getGst_registration();
		rmcd_approval_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getMerchant().getRmcd_approval_no();
		name = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getName();
		contact_person = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTName();
		designation = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTDesignation();
		email = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTEmail();
		tel_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTTel();
		fax_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTFax();
		esa_ref_no = ((CaseOutlet)request.getAttribute("c_outlet")).getESARefNo();
		no_of_terminal = ((CaseOutlet)request.getAttribute("c_outlet")).getNumTerminal();
		no_of_terminal = String.format("%02d", Integer.parseInt(no_of_terminal));
		terminal_rental = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmRental();
		terminal_owner = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmOwner();
		license_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLisenceNo();
		license_type = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLicenseType();
		state = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLicenseState();
		issuer = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLicenseIssuer();
		expiry = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLicenseExpiry();
		risk_level = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getRiskLevel();
		trm_deposit_wired = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmDepositWired();
		trm_deposit_wireless = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmDepositWireless();
		trm_rental_deposit_wired = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmRentalDepositWired();
		trm_rental_deposit_wireless = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmRentalDepositWireless();
		trm_rental_advance = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmRentalAdvance();
		cheque_amt = ((CaseOutlet)request.getAttribute("c_outlet")).getChequeAmt();
		
		String bank_issuer_branch = ((CaseOutlet)request.getAttribute("c_outlet")).getChequeIssuer();
		bank_issuer = bank_issuer_branch.substring(0, bank_issuer_branch.lastIndexOf('|'));
		bank_branch = bank_issuer_branch.substring(bank_issuer_branch.lastIndexOf('|') + 1);
		
		cheque_no = ((CaseOutlet)request.getAttribute("c_outlet")).getChequeNo();
		cheque_date = ((CaseOutlet)request.getAttribute("c_outlet")).getChequeDate();
		terminal_id = ((CaseOutlet)request.getAttribute("c_outlet")).getTerminalID();
		terminal_id_no = ((CaseOutlet)request.getAttribute("c_outlet")).getTerminalIDNo();
		terminal_install_date = ((CaseOutlet)request.getAttribute("c_outlet")).getTerminalInstallDate();
	}
	
	System.out.println(gst_registration + "----"+ rmcd_approval_no);
	boolean outlet_newable = true;
	boolean outlet_deletable = true;
	
	TreeMap<String, String> viewAccess = (TreeMap<String, String>) request.getAttribute("view_access");
	if(viewAccess.get("view_as").equals("maker") == false && viewAccess.get("view_as").equals("admin") == false){
		outlet_newable = false;
		outlet_deletable = false;
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="include/html-meta.jsp" />
<title>MAYBANK</title>
<script src="<%= request.getContextPath() %>/js/outlet.js"></script>
<script type="text/javascript">
	function onload() {
		var issuer = '<%= issuer %>';
		outlet.load_state_issuer($('select#state').val(), issuer);
	}
</script>

</head>

<body onload="onload();">

<!-- Header -->
<%@ include file="/jsp/common/Header.jsp" %>	
<!-- End Header -->

<div class="row-fluid page">
	<div class="span12">

		<jsp:include page="include/tab.jsp">
			<jsp:param name="active" value='<%=EncryptionHelper.encrypt("application") %>' />
		</jsp:include>
		
		<jsp:include page="include/app-tab.jsp">
			<jsp:param name="active" value='<%=EncryptionHelper.encrypt("outlet_info") %>' />
		</jsp:include>
		
		<div class="row-fluid">
			<div class="span2">
				<ul class="outletlist">
				<%
					String html = "";
					String css_class = "";
					
					for(CaseOutlet a : ((Casemast)request.getAttribute("m_case")).getOutlets()){
						Outlet o = a.getOutlet();
						
						css_class = "";
						
						if(request.getAttribute("c_outlet") != null) {
							if(o.getId() == ((CaseOutlet) request.getAttribute("c_outlet")).getOutlet().getId() && request.getAttribute("view").equals("outlet_detail")){
								css_class = " class=\"active\"";
							}
						}
						
						
						html = "<li" + css_class + "><a href=\"javascript:tab.load('/NewApp.do?dispatch=outlet_detail&o_id=" + EncryptionHelper.encryptEncodeURL(o.getId()+"") + "', '')\">" + o.getName() + "</a></li>";
						
						out.println(html);
					}
					
					css_class = " class=\"addnew\"";
					if(request.getAttribute("view").equals("outlet_create")) {
						css_class = " class=\"addnew active\"";
					}
					
					
					if(outlet_newable){
						html = "<li" + css_class + "><a href=\"javascript:tab.load('/NewApp.do?dispatch=outlet_create','')\">New Outlet</a></li>";
						out.println(html);
					}
				%>
				</ul>
				
				<div>
					
					<%
						if(outlet_newable){
							html = "<a class=\"btn\" href=\"javascript:tab.load('/NewApp.do?dispatch=outlet_create')\">Add</a>";
							out.println(html);
						}
					
						if(outlet_deletable && request.getAttribute("c_outlet") != null){
							html = "<button type=\"button\" class=\"btn\" onclick=\"outlet.delete_submit('" + EncryptionHelper.encrypt(request.getAttribute("case_id")+"") + "', '" + EncryptionHelper.encrypt(request.getAttribute("merchant_id")+"") + "', '" + EncryptionHelper.encrypt(((CaseOutlet) request.getAttribute("c_outlet")).getOutlet().getId()+"") + "')\">Delete</button>";
							out.println(html);
						}
					%>
					
				</div>
			</div>
			
			<div class="span10" style="border-left:1px solid #eee">
				<jsp:include page="include/outlet-tab.jsp">
					<jsp:param name="active" value='<%=EncryptionHelper.encrypt("outlet_detail") %>' />
				</jsp:include>
	
	
				<div class="form-horizontal main-content">
					<div class="row-fluid" style="width:1000px">
						<div class="span5">
							<div class="control-group">
								<label class="control-label"><span class="must">*</span>Trading Name</label>
								<div class="controls">
									<input type="text" id="trading_name" maxlength="25" value="<%= name %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Registered Name</label>
								<div class="controls">
									<input type="text" id="registered_name" value="<%= reg_name %>" />
									<input type="hidden" id="gst_registration" value="<%=gst_registration%>">
									<input type="hidden" id="rmcd_approval_no" value="<%=rmcd_approval_no%>">
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Business Registration No.</label>
								<div class="controls">
									<input type="text" id="business_reg_no" value="<%= reg_no %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Contact Person</label>
								<div class="controls">
									<input type="text" id="contact_person" placeholder="Authorize mPOS Mobile User Recipient" value="<%= contact_person %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Designation</label>
								<div class="controls">
									<input type="text" id="designation" value="<%= designation %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Email</label>
								<div class="controls">
									<input type="text" id="email" placeholder="Mandatory for mPOS Application" value="<%= email %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Telephone No</label>
								<div class="controls">
									<input type="text" id="telephone_no" placeholder="Handphone No. is Required for mPOS Application" value="<%= tel_no %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Fax No.</label>
								<div class="controls">
									<input type="text" id="fax_no" value="<%= fax_no %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">ESA Reference No.</label>
								<div class="controls">
									<input type="text" id="esa_ref_no" value="<%= esa_ref_no %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">No. of Terminal with TRF</label>
								<div class="controls">
									<input type="text" id="no_of_terminal" value="<%= no_of_terminal %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Terminal Rental Fee</label>
								<div class="controls">				
									<select id="terminal_rental_fee">
									<%
										html = "<option value=\"00\">00 - no TRF</option>"
											+ "<option value=\"01\">01 - RM 180</option>"
											+ "<option value=\"02\">02 - RM 150</option>"
											+ "<option value=\"03\">03 - RM 100</option>"
											+ "<option value=\"04\">04 - RM 170</option>"
											+ "<option value=\"05\">05 - RM 190</option>"
											+ "<option value=\"06\">06 - RM 129</option>"
											+ "<option value=\"07\">07 - RM 200</option>"
											+ "<option value=\"08\">08 - RM 250</option>"
											+ "<option value=\"09\">09 - RM 80</option>"
											+ "<option value=\"10\">10 - RM 75</option>"
											+ "<option value=\"11\">11 - RM 70</option>"
											+ "<option value=\"12\">12 - RM 60</option>"
											+ "<option value=\"13\">13 - RM 55</option>"
											+ "<option value=\"14\">14 - RM 50</option>"
											+ "<option value=\"15\">15 - RM 140</option>"
											+ "<option value=\"16\">16 - RM 90</option>"
											+ "<option value=\"17\">17 - RM 175</option>"
											+ "<option value=\"18\">18 - RM 160</option>"
											+ "<option value=\"19\">19 - (F) RM 100 (W) RM 150</option>"
											+ "<option value=\"20\">20 - RM 165</option>"
											+ "<option value=\"21\">21 - (F) RM 80 (W) RM 180</option>"
											+ "<option value=\"22\">22 - (F) RM 80 (W) RM 175</option>"
											+ "<option value=\"23\">23 - (F) RM 100 (W) RM 175</option>"
											+ "<option value=\"24\">24 - (F) RM 100 (W) RM 150</option>"
											+ "<option value=\"25\">25 - (F) RM 60 (W) RM 100</option>"
											+ "<option value=\"26\">26 - RM 130</option>"
											+ "<option value=\"27\">27 - (F) RM 80  (W) RM140</option>"
											+ "<option value=\"28\">28 - (F) RM 80 (W) RM 150</option>"
											+ "<option value=\"29\">29 - RM 110</option>"
											+ "<option value=\"30\">30 - RM 125</option>"
											+ "<option value=\"31\">31 - RM 120</option>"
											+ "<option value=\"32\">32 - (F) RM 55 (W) RM 180</option>"
											+ "<option value=\"33\">33 - (F) RM 80 (W) RM 150</option>"
											+ "<option value=\"34\">34 - RM 38</option>"
											+ "<option value=\"35\">35 - (F) RM 80 (W) RM 100</option>"
											+ "<option value=\"36\">36 - (F) RM55 (W) RM180</option>"
											+ "<option value=\"37\">37 - (F) RM55 (F) RM 80</option>"
											+ "<option value=\"38\">38 - RM135</option>"
											+ "<option value=\"39\">39 - (F) RM80 (W) RM180</option>"
											+ "<option value=\"40\">40 - (F) RM55 (W) RM150</option>"
											+ "<option value=\"41\">41 - (F) RM50 (W) RM80</option>"
											+ "<option value=\"42\">42 - (F) RM80 (W) RM130</option>"
											+ "<option value=\"43\">43 - (F) RM55 (W) RM130</option>"
											+ "<option value=\"44\">44 - (F) RM80 (W) RM120</option>"
											+ "<option value=\"45\">45 - RM35</option>"
											+ "<option value=\"46\">46 - (F) RM80 (W) RM135</option>"
											+ "<option value=\"47\">47 - (F) RM60 (W) RM150</option>"
											+ "<option value=\"48\">48 - (F) RM60 (W) RM120</option>"
											+ "<option value=\"49\">49 - (F) RM60 (W) RM180</option>"
											+ "<option value=\"50\">50 - RM40</option>"
											+ "<option value=\"51\">51 - (F) RM80 (W) RM125</option>"
											+ "<option value=\"52\">52 - RM65</option>"
											+ "<option value=\"53\">53 - RM10</option>";						
										html = html.replace("value=\"" + terminal_rental + "\"", "value=\"" + terminal_rental + "\" selected ");
										
										out.println(html);
									%>
									</select>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Terminal Owner with TRF</label>
								<div class="controls">
									<select id="terminal_owner">
									<%
										html = "<option value=\"00\">00 - Not Available</option>"
											+ "<option value=\"01\">01 - Maybank</option>"
											+ "<option value=\"02\">02 - Paysys</option>"
											+ "<option value=\"03\">03 - ESA </option>"
											+ "<option value=\"04\">04 - Maybank & Paysys</option>"
											+ "<option value=\"05\">05 - ESA (Wired) & Paysys (Wireless)</option>"
											+ "<option value=\"06\">06 - Maybank & GHL (Wireless)</option>"
											+ "<option value=\"07\">07 - Maybank Phillipines</option>"
											+ "<option value=\"08\">08 - Maybank Singapore</option>"
											+ "<option value=\"09\">09 - MBB (Wired) & Sinopay (Wireless)</option>"
											+ "<option value=\"10\">10 - MBB (Wired) & ITBIZ (Wireless)</option>"
											+ "<option value=\"11\">11 - ESA (Wired) & ITBIZ (Wireless)</option>"
											+ "<option value=\"12\">12 - MBB (Wired) & MPSB (Wireless)</option>"
											+ "<option value=\"13\">13 - ESA (Wired) & GHL (Wireless)</option>";						
										
										html = html.replace("value=\"" + terminal_owner + "\"", "value=\"" + terminal_owner + "\" selected ");
										
										out.println(html);
									%>
									</select>
								</div>
							</div>
						</div>
						
						<div class="span5">
							<div class="control-group">
								<label class="control-label">Business License No.</label>
								<div class="controls">
									<input type="text" id="business_license_no" value="<%= license_no %>" />
								</div>
							</div>
							
							<div class="control-group" style="text-align:right" id="license_type">
							<%
								html = "<label class=\"radio inline-block\"><input type=\"radio\" name=\"business_license_type\" value=\"permanent\" />Permanent</label>"
								+ "<label class=\"radio inline-block\"><input type=\"radio\" name=\"business_license_type\" value=\"temporary\" />Temporary</label>"
								+ "<label class=\"radio inline-block\"><input type=\"radio\" name=\"business_license_type\" value=\"na\" />N/A</label>";
								
								html = html.replace("value=\"" + license_type + "\"", "value=\"" + license_type + "\" checked ");
					
								out.println(html);
							%>
							</div>
							
							<div class="control-group">
								<label class="control-label">State</label>
								<div class="controls">
									<select id="state" onchange="outlet.load_state_issuer(this.value, '');">
										<option value=""></option>
										<%
											html = "<option value=\"WILAYAH PERSEKUTUAN KUALA LUMPUR\">WILAYAH PERSEKUTUAN KUALA LUMPUR</option>"
												+ "<option value=\"SELANGOR\">SELANGOR</option>"
												+ "<option value=\"KEDAH\">KEDAH</option>"
												+ "<option value=\"PERLIS\">PERLIS</option>"
												+ "<option value=\"PULAU PINANG\">PULAU PINANG</option>"
												+ "<option value=\"PERAK\">PERAK</option>"
												+ "<option value=\"NEGERI SEMBILAN\">NEGERI SEMBILAN</option>"
												+ "<option value=\"MELAKA\">MELAKA</option>"
												+ "<option value=\"JOHOR\">JOHOR</option>"
												+ "<option value=\"TERENGGANU\">TERENGGANU</option>"
												+ "<option value=\"PAHANG\">PAHANG</option>"
												+ "<option value=\"KELANTAN\">KELANTAN</option>"
												+ "<option value=\"SABAH\">SABAH</option>"
												+ "<option value=\"SARAWAK\">SARAWAK</option>"
												+ "<option value=\"WILAYAH PERSEKUTUAN PUTRAJAYA\">WILAYAH PERSEKUTUAN PUTRAJAYA</option>"
												+ "<option value=\"WILAYAH PERSEKUTUAN LABUAN\">WILAYAH PERSEKUTUAN LABUAN</option>";
											
											html = html.replace("value=\"" + state + "\"", "value=\"" + state + "\" selected ");
					
											out.println(html);
										%>
									</select>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Issuer</label>
								<div class="controls">
									<select id="issuer">
										<!-- <jsp:include page="include/municipal-council-options.jsp">
											<jsp:param name="issuer" value='<%=EncryptionHelper.encrypt("issuer") %>' />
										</jsp:include> -->
									</select>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Expiry Date</label>
								<div class="controls">
									<input type="text" id="expiry_date" value="<%= expiry %>" placeholder="ddmmyyyy" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Risk Level</label>
								<div class="controls">
									<select id="risk_level">
										<option value=""></option>
										<% 
											html = "<option value=\"HI\">HI</option>"
												 + "<option value=\"ME\">ME</option>"
												 + "<option value=\"LO\">LO</option>";
												 
											html = html.replace("value=\"" + risk_level + "\"", "value=\"" + risk_level + "\" selected ");
													
											out.println(html);
										%>
									</select>
								</div>
							</div>
							
							<div class="control-group" style="background-color:#eee; text-align:center">
								<label class="control-label" style="font-weight:bold; float:none; display:inline-block; text-align:center">Terminal Fee</label>
							</div>
							
							<div class="control-group">
								<label class="control-label">Terminal Deposit (Wired)</label>
								<div class="controls">
									<input type="text" id="terminal_deposit_wired" value="<%= trm_deposit_wired %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Terminal Deposit (Wireless)</label>
								<div class="controls">
									<input type="text" id="terminal_deposit_wireless" value="<%= trm_deposit_wireless %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Terminal Rental Deposit (Wired)</label>
								<div class="controls">
									<input type="text" id="terminal_rental_deposit_wired" value="<%= trm_rental_deposit_wired %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Terminal Rental Deposit (Wireless)</label>
								<div class="controls">
									<input type="text" id="terminal_rental_deposit_wireless" value="<%= trm_rental_deposit_wireless %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Advance Terminal Rental</label>
								<div class="controls">
									<input type="text" id="advance_terminal_rental" value="<%= trm_rental_advance %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Total Cheque Amount</label>
								<div class="controls">
									<input type="text" id="total_cheque_amt" value="<%= cheque_amt %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Bank Issuer / Branch</label>
								<div class="controls">
									<select id="bank_issuer" style="width:99px">
										<option value=""></option>
										<% 
											html = "<option value=\"AFFIN BANK BERHAD\">AFFIN BANK BERHAD</option>"
													+ "<option value=\"ALLIANCE BANK MALAYSIA BHD\">ALLIANCE BANK MALAYSIA BHD</option>"
													+ "<option value=\"AL-RAJHI BANKING & INVESTMENT CORP (M) BHD\">AL-RAJHI BANKING & INVESTMENT CORP (M) BHD</option>"
													+ "<option value=\"AMBANK BERHAD\">AMBANK BERHAD</option>"
													+ "<option value=\"BANK ISLAM MALAYSIA\">BANK ISLAM MALAYSIA</option>"
													+ "<option value=\"BANK KERJASAMA RAKYAT MALAYSIA BHD\">BANK KERJASAMA RAKYAT MALAYSIA BHD</option>"
													+ "<option value=\"BANK MUAMALAT\">BANK MUAMALAT</option>"
													+ "<option value=\"BANK OF AMERICA\">BANK OF AMERICA</option>"
													+ "<option value=\"BANK OF CHINA\">BANK OF CHINA</option>"
													+ "<option value=\"BANK OF TOKYO\">BANK OF TOKYO</option>"
													+ "<option value=\"BANK PERTANIAN MALAYSIA BHD (AGRO BANK)\">BANK PERTANIAN MALAYSIA BHD (AGRO BANK)</option>"
													+ "<option value=\"BANK RAKYAT MALAYSIA\">BANK RAKYAT MALAYSIA</option>"
													+ "<option value=\"BANK SIMPANAN NASIONAL BHD\">BANK SIMPANAN NASIONAL BHD</option>"
													+ "<option value=\"BNP PARIBAS MALAYSIA\">BNP PARIBAS MALAYSIA</option>"
													+ "<option value=\"CIMB BANK BERHAD\">CIMB BANK BERHAD</option>"
													+ "<option value=\"CITIBANK BERHAD\">CITIBANK BERHAD</option>"
													+ "<option value=\"DEUTSCHE BANK (M) BHD\">DEUTSCHE BANK (M) BHD</option>"
													+ "<option value=\"EON BANK BERHAD\">EON BANK BERHAD</option>"
													+ "<option value=\"HONG LEONG BANK BHD\">HONG LEONG BANK BHD</option>"
													+ "<option value=\"HSBC BANK MALAYSIA BERHAD\">HSBC BANK MALAYSIA BERHAD</option>"
													+ "<option value=\"J.P. MORGAN CHASE BANK BHD\">J.P. MORGAN CHASE BANK BHD</option>"
													+ "<option value=\"KUWAIT FINANCE HOUSE\">KUWAIT FINANCE HOUSE</option>"
													+ "<option value=\"MALAYAN BANKING BERHAD\">MALAYAN BANKING BERHAD</option>"
													+ "<option value=\"MIZUHO CORPORATE BANK MALAYSIA\">MIZUHO CORPORATE BANK MALAYSIA</option>"
													+ "<option value=\"OCBC BANK (M) BHD\">OCBC BANK (M) BHD</option>"
													+ "<option value=\"PUBLIC BANK BHD\">PUBLIC BANK BHD</option>"
													+ "<option value=\"RHB BANK BERHAD\">RHB BANK BERHAD</option>"
													+ "<option value=\"ROYAL BANK OF SCOTLAND\">ROYAL BANK OF SCOTLAND</option>"
													+ "<option value=\"STANDARD CHARTERED BANK\">STANDARD CHARTERED BANK</option>"
													+ "<option value=\"SUMITOMO MITSUI BANK CORPORATION MALAYSIA BHD\">SUMITOMO MITSUI BANK CORPORATION MALAYSIA BHD</option>"
													+ "<option value=\"THE ROYAL BANK OF SCOTLAND BHD\">THE ROYAL BANK OF SCOTLAND BHD</option>"
													+ "<option value=\"UNITED OVERSEAS BANK BHD\">UNITED OVERSEAS BANK BHD</option>";
											
											html = html.replace("<option value=\"" + bank_issuer + "\">", "<option value=\"" + bank_issuer + "\" selected />");		
											out.println(html);
										%>
									</select>
									<input type="text" id="bank_branch" style="width:79px" value="<%= bank_branch %>"/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Cheque No. / Cheque Date</label>
								<div class="controls">
									<input type="text" id="cheque_no" style="width:110px" value="<%= cheque_no %>"/>
									<input type="text" id="cheque_date" style="width:79px" placeholder="ddmmyyyy" value="<%= cheque_date %>"/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Terminal ID</label>
								<div class="controls">
									<input type="text" id="terminal_id" style="width:145px" readonly="readonly" value="<%= terminal_id %>"/>
									<input type="text" id="terminal_id_no" style="width:44px" readonly="readonly" value="<%= terminal_id_no %>"/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Terminal Installation Date</label>
								<div class="controls">
									<input type="text" id="terminal_install_date" readonly="readonly" value="<%= terminal_install_date %>"/>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			
		</div>
		
		<div class="row-fluid">
			<div class="span12 btn-control">
				<input id="click_redirect" name="click_redirect" type="hidden" value="" />
				<input id="click_filter" name="click_filter" type="hidden" value="" />
				<% 
					String onclick = "outlet.create_outlet_detail('" + request.getParameter("m_id") + "', '" + request.getParameter("c_id") + "');";
					if(!"outlet_create".equalsIgnoreCase(request.getParameter("dispatch"))) {
						onclick = "outlet.edit_outlet_detail('" + request.getParameter("c_id") + "', '" + request.getParameter("o_id") + "');";
					}
				%>
				
				<button type="submit" class="btn" id="submit" onclick="<%= onclick %>">Save</button>
			</div>
		</div>
	</div>
</div>

<!-- Footer -->
<%@ include file="/jsp/common/Footer.jsp" %>	
<!-- End Footer -->
</body>
</html>